<script setup>
import {ref, onMounted} from 'vue';
import http from '/src/utils/http.js';
const list=ref([])

const getUserList=async()=>{
    const response=await http.get('/user/list')
    list.value=response.data
}
onMounted(()=>{
    console.log('用户请求')
    getUserList();
}
)
</script>
<template>
    <div>
        <h1>个人中心</h1>
        <el-row v-if="list.length > 0">
            <el-col :span="4">
            <el-card v-for="user in list" :key="user.id">               
                <p>{{user.name}}</p>
                <p>{{user.gender}}</p>
                <el-link :href="'/user/ + user.id'">查看详情</el-link>
            </el-card>
        </el-col>
      </el-row>
    </div>
</template>